import numpy as np
import pandas as pd

# 创建日期索引
dates = pd.date_range('20130101', periods=6)

# 创建DateFrame模拟数据
# np.random.randn(6, 4) 创建6行4列的随机数
df = pd.DataFrame(np.random.randn(6, 4), index=dates, columns=list('ABCD'))

df2 = df.copy()
df2['E'] = ['one', 'one', 'two', 'three', 'four', 'three']

print(df2[df2['E'].isin(['two', 'four'])])
